// REMOVE THE CRAP FROM THE TOSTRING LATER

package ocrs.server.registeringSystem;

import com.google.appengine.api.datastore.Key;
//import com.google.appengine.api.users.User;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import java.util.ArrayList;

@PersistenceCapable
public class Course implements Comparable<Course> 
{
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key theKey;
	
	@Persistent
	private String courseID;
	
	@Persistent
	private ArrayList<User> studentList;
	
	@Persistent
	private String semester;
	
	@Persistent
	private int year;
	
	@Persistent
	private int capacity;               
	
	//@Persistent
	//private int numberOfStudentsRegistered;
	
	@Persistent
	private String courseName;
	
	@Persistent
	private int sectionNumber;
	
	@Persistent
	private String instructorName;
	
	// REMOVE THIS?
	@Persistent
	private String teachingAssistantName;
	
	@Persistent
	private Location teachingLocation;
	
	@Persistent
	private ArrayList<String> daysHeld;
	
	@Persistent
	private Time timeHeld;
	
	// REMOVE THIS?
	@Persistent
	private int numberOfWeeks;
	
	@Persistent
	private int numberOfTotalCredits;
	
	@Persistent
	private String courseExcerpt;
	
	@Persistent
	private MonthDayYear startDate;
	
	@Persistent
	private MonthDayYear endDate;
	
	@Persistent
	private ArrayList<String> prerequisitesNeededForThisCourse;
	//private StringArrayPlusCharacter[] prerequisitesNeededForThisCourse;
	
	@Persistent
	private ArrayList<User> waitList;
	
	@Persistent
	private ArrayList<StringPlusCharacter> dropAndWithdrawList;
	
	
	
	public Course()
	{
		capacity = 0;
		courseID = "";
		studentList = new ArrayList<User>();
		semester = "";
		year = 0;
		courseName = "";
		sectionNumber = 0;
		instructorName = "";
		teachingAssistantName = "";
		teachingLocation = new Location();
		daysHeld = new ArrayList<String>();
		timeHeld = new Time();
		numberOfWeeks = 0;
		numberOfTotalCredits = 0;
		courseExcerpt = "";
		startDate = new MonthDayYear();
		endDate = new MonthDayYear();
		prerequisitesNeededForThisCourse = new ArrayList<String>();
		waitList = new ArrayList<User>();
		dropAndWithdrawList = new ArrayList<StringPlusCharacter>();
	}
	
	
	public Course(String courseID, ArrayList<User> studentList, 
			      String semester, int year, int capacity,
			      String className, int sectionNumber, String instructorName,
			      String teachingAssistantName, Location teachingLocation,
			      ArrayList<String> daysHeld, Time timeHeld, int numberOfWeeks,
			      int numberOfCredits, String courseExcerpt, 
			      MonthDayYear startDate, MonthDayYear endDate, 
			      ArrayList<String> prerequisitesNeededForThisCourse,
			      ArrayList<User> waitList, 
			      ArrayList<StringPlusCharacter> dropAndWithdrawList)
	{
		this.courseID = courseID;
		this.studentList = studentList;
		this.semester = semester;
		this.year = year;
		this.capacity = capacity;
		this.courseName = className;
		this.sectionNumber = sectionNumber;
		this.instructorName = instructorName;
		this.teachingAssistantName = teachingAssistantName;
		this.teachingLocation = teachingLocation;
		this.daysHeld = daysHeld;
		this.timeHeld = timeHeld;
		this.numberOfWeeks = numberOfWeeks;
		this.numberOfTotalCredits = numberOfCredits;
		this.courseExcerpt = courseExcerpt;
		this.startDate = startDate;
		this.endDate = endDate;
		this.prerequisitesNeededForThisCourse = 
			                                  prerequisitesNeededForThisCourse;
		this.waitList = waitList;
		this.dropAndWithdrawList = dropAndWithdrawList;
	} // end of constructor
	
	
	
	/** 
     * Name: User <br><br>
     * The copy constructor that initializes the private data members with the
     * same values with as the argument.  It is a deep copy.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Performs a deep copy of the argument object.
     * @param copyThis - the object that will be copied
     * @throws NullReferenceException is thrown is when a null reference is
     *         passed in
     */
	/*
    public User(User copyThis) throws NullReferenceException
    {
    	if(copyThis == null)
    		throw new NullReferenceException("Can not copy and create User " +
    				                         "object because a null reference " +
    				                         "was passed in!\n");
    	
    	this.month = copyThis.month;
    	this.day = copyThis.day;
    	this.year = copyThis.year;
    } // end of copy constructor
    */
	
	
	/** 
     * Name: getTheKey <br><br>
     * An accessor method that retrieves the key for the object in the
     * Google datastore.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the key. <br>
     * @param None
     */
	public Key getTheKey()
	{
		return theKey;
	} // end of getTheKey()
	
	
	
	/** 
     * Name: getCourseID <br><br>
     * An accessor method that retrieves the courseID.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the courseID time. <br>
     * @param None
     */
	public String getCourseID()
	{
		return courseID;
	} // end of getCourseID()
	
	
	
	/** 
     * Name: getStudentList <br><br>
     * An accessor method that retrieves the student list.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the student list. <br>
     * @param None
     */
	public ArrayList<User> getStudentList()
	{
		return studentList;
	} // end of getStudentList()
	
	
	
	/** 
     * Name: getSemester <br><br>
     * An accessor method that retrieves the semester.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the semester. <br>
     * @param None
     */
	public String getSemester()
	{
		return semester;
	} // end of getSemester()
	
	
	
	/** 
     * Name: getYear <br><br>
     * An accessor method that retrieves the year.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the year the class was held. <br>
     * @param None
     */
	public int getYear()
	{
		return year;
	} // end of getYear()
	
	
	
	/** 
     * Name: getCapacity <br><br>
     * An accessor method that retrieves the capacity of the class.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the capacity of the class. <br>
     * @param None
     */
	public int getCapacity()
	{
		return capacity;
	} // end of getCapacity()
	
	
	
	/** 
     * Name: getCourseName <br><br>
     * An accessor method that retrieves the course name.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the course name. <br>
     * @param None
     */
	public String getCourseName()
	{
		return courseName;
	} // end of getCourseName()
	
	
	
	/** 
     * Name: getSectionNumber <br><br>
     * An accessor method that retrieves the section number.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the section number. <br>
     * @param None
     */
	public int getSectionNumber()
	{
		return sectionNumber;
	} // end of getSectionNumber()
	
	
	
	/** 
     * Name: getInstructorName <br><br>
     * An accessor method that retrieves the instructor's name for the Course.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the instructor's name. <br>
     * @param None
     */
	public String getInstructorName()
	{
		return instructorName;
	} // end of getInstructorName()
	
	
	
	/** 
     * Name: getTeachingAssistantName <br><br>
     * An accessor method that retrieves the teaching assistant's name.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the teaching assistant's name. <br>
     * @param None
     */
	public String getTeachingAssistantName()
	{
		return teachingAssistantName;
	} // end of getteachingAssistantName()
	
	
	
	/** 
     * Name: getTeachingLocation <br><br>
     * An accessor method that retrieves the Location where the course is held.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the location of the Course. <br>
     * @param None
     */
	public Location getTeachingLocation()
	{
		return teachingLocation;
	} // end of getTeachingLocation()
	
	
	
	/** 
     * Name: getDaysHeld <br><br>
     * An accessor method that retrieves the days that the Course is held.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the days that the Course is held. <br>
     * @param None
     */
	public ArrayList<String> getDaysHeld()
	{
		return daysHeld;
	} // end of getDaysHeld()
	
	
	
	/** 
     * Name: getTimeHeld <br><br>
     * An accessor method that retrieves when the Course is held.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the when the Course is held. <br>
     * @param None
     */
	public Time getTimeHeld()
	{
		return timeHeld;
	} // end of getTimeHeld()
	
	
	
	/** 
     * Name: getNumberOfWeeks <br><br>
     * An accessor method that retrieves the number of weeks for the Course.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the number of weeks for the Course. <br>
     * @param None
     */
	public int getNumberOfWeeks()
	{
		return numberOfWeeks;
	} // end of getNumberOfWeeks()
	
	
	
	/** 
     * Name: getNumberOfCredits <br><br>
     * An accessor method that retrieves the number of credits for the Course.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the number of credits for the Course. <br>
     * @param None
     */
	public int getNumberOfCredits()
	{
		return numberOfTotalCredits;
	} // end of getNumberOfCredits()
	
	
	
	/** 
     * Name: getCourseExcerpt <br><br>
     * An accessor method that retrieves the Course description.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the course description. <br>
     * @param None
     */
	public String getCourseExcerpt()
	{
		return courseExcerpt;
	} // end of getCourseExcerpt()
	
	
	
	/** 
     * Name: getStartDate <br><br>
     * An accessor method that retrieves the start date for the Course.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the starting date. <br>
     * @param None
     */
	public MonthDayYear getStartDate()
	{
		return startDate;
	} // end of getStartDate()
	
	
	
	/** 
     * Name: getEndingDate <br><br>
     * An accessor method that retrieves the end date for the Course.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the ending date. <br>
     * @param None
     */
	public MonthDayYear getEndDate()
	{
		return endDate;
	} // end of getEndDate()
	
	
	
	/** 
     * Name: getPrerequisitesNeededForThisCourse <br><br>
     * An accessor method that retrieves the prerequisites needed for this
     * Course.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the prerequisites needed for the Course. <br>
     * @param None
     */
	public ArrayList<String> getPrerequisitesNeededForThisCourse()
	{
		return prerequisitesNeededForThisCourse;
	} // end of getPrerequisitesNeededforthisCourse()
	
	
	
	/** 
     * Name: getWaitList <br><br>
     * An accessor method that retrieves the wait list.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the wait list. <br>
     * @param None
     */
	public ArrayList<User> getWaitList()
	{
		return waitList;
	} // end of getWaitList()
	
	
	
	/** 
     * Name: getDropAndWithdrawList <br><br>
     * An accessor method that retrieves the withdraw list.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns the withdraw list. <br>
     * @param None
     */
	public ArrayList<StringPlusCharacter> getDropAndWithdrawList()
	{
		return dropAndWithdrawList;
	} // end of getDropAndWithdrawList()
	
	
	
	/** 
     * Name: setCourseID <br><br>
     * A mutator to change the courseID field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the courseID to the value passed in.
     * <br>
     * @param courseID - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setCourseID(String courseID) throws NullReferenceException
	{
		if(courseID == null)
			throw new NullReferenceException("Did not set the courseID " +
					                         "because a null reference was " +
					                         "passed in!\n");
		
		this.courseID = courseID;
	} // end of setCourse()
	
	
	
	/** 
     * Name: setStudentList <br><br>
     * A mutator to change the studentList field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the studentList to the value passed in.
     * <br>
     * @param studentList - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setStudentList(ArrayList<User> studentList) 
	                                              throws NullReferenceException
	{
		if(studentList == null)
			throw new NullReferenceException("Did not set the student list " +
					                         "because a null reference was " +
					                         "passed in!\n");
		
		this.studentList = studentList;
	} // end of setStudentList()
	
	
	
	/** 
     * Name: setSemester <br><br>
     * A mutator to change the semester field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the semester to the value passed in.
     * <br>
     * @param semester - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setSemester(String semester) throws NullReferenceException
	{
		if(semester == null)
			throw new NullReferenceException("Did not set the semester " +
					                         "because a null reference was " +
					                         "passed in!\n");
		this.semester = semester;
	} // end of setSemester()
	
	
	
	/** 
     * Name: setYear <br><br>
     * A mutator to change the year field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the year to the value passed in.
     * <br>
     * @param year - the argument that will be used to set the field
     * @throws NotValidArgumentException is thrown when a negative number is 
     *         passed in.
     */
	public void setYear(int year) throws NotValidArgumentException
	{
		if(year < 0)
			throw new NotValidArgumentException("Did not set the year " +
					                            "because a negative number " +
					                            "was passed in!\n");
		
		this.year = year;
	} // end of setYear()
	
	
	
	/** 
     * Name: setCapacity <br><br>
     * A mutator to change the capacity field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the capacity to the value passed in.
     * <br>
     * @param capacity - the argument that will be used to set the field
     * @throws NotValidArgumentException is thrown when a negative number is
     *         passed in.
     */
	public void setCapacity(int capacity) throws NotValidArgumentException
	{
		if(capacity < 0)
			throw new NotValidArgumentException("Did not set the capacity " +
					                            "because a negative number " +
					                            "was passed in!\n");
		
		this.capacity = capacity;
	} // end of setCapacity()
	
	
	
	/** 
     * Name: setCourseName <br><br>
     * A mutator to change the courseName field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the courseName to the value passed in.
     * <br>
     * @param courseName - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setCourseName(String courseName) throws NullReferenceException
	{
		if(courseName == null)
			throw new NullReferenceException("Did not set the course name " +
					                         "because a null reference was " +
					                         "passed in!\n");
		
		this.courseName = courseName;
	} // end of setCourseName()
	
	
	
	/** 
     * Name: setSectionNumber <br><br>
     * A mutator to change the sectionNumber field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the sectionNumber to the value passed in.
     * <br>
     * @param sectionNumber - the argument that will be used to set the field
     * @throws NotValidArgumentException is thrown when a null reference is 
     *         passed in.
     */
	public void setSectionNumber(int sectionNumber) 
	                                           throws NotValidArgumentException
	{
		if(sectionNumber < 0)
			throw new NotValidArgumentException("Did not set the section " +
					                            "number because a negative " +
					                            "number was passed in!\n");
		
		this.sectionNumber = sectionNumber;
	} // end of setSectionNumber()
	
	
	
	/** 
     * Name: setInstructorName <br><br>
     * A mutator to change the instructorName field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the instructorName to the value passed in.
     * <br>
     * @param instructorName - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setInstructorName(String instructorName)
	                                              throws NullReferenceException
	{
		if(instructorName == null)
			throw new NullReferenceException("Did not set the instructor's " +
					                         "name because a null reference " +
					                         "was passed in!\n");
		
		this.instructorName = instructorName;
	} // end of setInstructorName()
	
	
	
	/** 
     * Name: setTeachingAssistantName <br><br>
     * A mutator to change the teachingAssistantName field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the teachingAssistantName to the value passed in.
     * <br>
     * @param teachingAssistantName - the argument that will be used to set the
     *                                field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setTeachingAssistantName(String teachingAssistantName) 
	                                              throws NullReferenceException
	{
		if(teachingAssistantName == null)
			throw new NullReferenceException("Did not set the teaching " +
					                         "assistant's name because a " +
					                         "null reference was passed " +
					                         "in!\n");
		
		this.teachingAssistantName = teachingAssistantName;
	} // end of setTeachingAssitantName()
	
	
	
	/** 
     * Name: setTeachingLocation <br><br>
     * A mutator to change the teachingLocation field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the teachingLocation to the value passed in.
     * <br>
     * @param teachingLocation - the argument that will be used to set the
     *                           field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setTeachingLocation(Location teachingLocation) 
	                                              throws NullReferenceException
	{
		if(teachingLocation == null)
			throw new NullReferenceException("Did not set the teaching " +
					                         "location because a null " +
					                         "reference was passed in!\n");
		
		this.teachingLocation = teachingLocation;
	} // end of setTeachingLocation()
	
	
	
	/** 
     * Name: setDaysHeld <br><br>
     * A mutator to change the daysHeld field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the daysHeld to the value passed in.
     * <br>
     * @param daysHeld - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setDaysHeld(ArrayList<String> daysHeld) 
	                                              throws NullReferenceException
	{
		if(daysHeld == null)
			throw new NullReferenceException("Did not set the days held " +
					                         "because a null reference was " +
					                         "passed in!\n");
		
		this.daysHeld = daysHeld;
	} // end of setDaysHeld()
	
	
	
	/** 
     * Name: setTimeHeld <br><br>
     * A mutator to change the timeHeld field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the timeHeld to the value passed in.
     * <br>
     * @param timeHeld - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setTimeHeld(Time timeHeld) throws NullReferenceException
	{
		if(timeHeld == null)
			throw new NullReferenceException("Did not set the time held " +
					                         "because a null reference was " +
					                         "passed in!\n");
		
		this.timeHeld = timeHeld;
	} // end of setTimeHeld()
	
	
	
	/** 
     * Name: setNumberOfWeeks <br><br>
     * A mutator to change the numberOfWeeks field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the numberOfWeeks to the value passed in.
     * <br>
     * @param numberOfWeeks - the argument that will be used to set the field
     * @throws NotValidArgumentException is thrown when a null reference is
     *         passed in.
     */
	public void setNumberOfWeeks(int numberOfWeeks) 
	                                           throws NotValidArgumentException
	{
		if(numberOfWeeks < 0)
			throw new NotValidArgumentException("Did not set the number of " +
					                            "weeks because a negative " +
					                            "number was passed in!\n");
		
		this.numberOfWeeks = numberOfWeeks;
	} // end of setNumberOfWeeks()
	
	
	
	/** 
     * Name: setNumberOfCredits <br><br>
     * A mutator to change the numberOfCredits field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the numberOfCredits to the value passed in.
     * <br>
     * @param numberOfcrdits - the argument that will be used to set the field
     * @throws NotValidArgumentException is thrown when a null reference is 
     *         passed in.
     */
	public void setNumberOfCredits(int numberOfCredits) 
	                                           throws NotValidArgumentException
	{
		if(numberOfCredits < 0)
			throw new NotValidArgumentException("Did not set the number of " +
					                            "credits because a negative " +
					                            "number was passed in!\n");
		this.numberOfTotalCredits = numberOfCredits;
	} // end of setNumberOfCredits()
	
	
	
	/** 
     * Name: setCourseExcerpt <br><br>
     * A mutator to change the courseExcerpt field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the courseExcerpt to the value passed in.
     * <br>
     * @param courseExcerpt - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setCourseExcerpt(String courseExcerpt) 
	                                              throws NullReferenceException
	{
		if(courseExcerpt == null)
			throw new NullReferenceException("Did not set the course " +
					                         "excerpt because a null " +
					                         "reference was passed in!\n");
		
		this.courseExcerpt = courseExcerpt;
	} // end of setCourseExcerpt()
	
	
	
	/** 
     * Name: setStartDate <br><br>
     * A mutator to change the startDate field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the startDate to the value passed in.
     * <br>
     * @param startDate - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setStartDate(MonthDayYear startDate) 
	                                              throws NullReferenceException
	{
		if(startDate == null)
			throw new NullReferenceException("Did not set the start date " +
					                         "because a null reference was " +
					                         "passed in!\n");
		this.startDate = startDate;
	} // end of setStartDate()
	
	
	
	/** 
     * Name: setEndDate <br><br>
     * A mutator to change the endDate field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the endDate to the value passed in.
     * <br>
     * @param endDate - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setEndDate(MonthDayYear endDate) throws NullReferenceException
	{
		if(endDate == null)
			throw new NullReferenceException("Did not set the end date " +
					                         "because a null reference was " +
					                         "passed in!\n");
		this.endDate = endDate;
	} // end of setEndDate()
	
	
	
	/** 
     * Name: setPrerequisitesNeededForThisCourse <br><br>
     * A mutator to change the prerequisitesNeededforThisCourse field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the prerequisitesNeededForThisCourse to the value
     *                passed in.
     * <br>
     * @param prerequisitiesNeededForThisCourse - the argument that will be 
     *                                            used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setPrerequisitesNeededForThisCourse(
			               ArrayList<String> prerequisitiesNeededForThisCourse)
	                                             throws NullReferenceException
	{
		if(prerequisitiesNeededForThisCourse == null)
			throw new NullReferenceException("Did not set the prerequisites" +
					                         "because a null reference was " +
					                         "passed in!\n");
		
		this.prerequisitesNeededForThisCourse = 
			                                 prerequisitiesNeededForThisCourse;
	} // end of setPrerequisitesNeedForThisCourse()
	
	
	
	/** 
     * Name: setWaitList <br><br>
     * A mutator to change the waitList field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the waitList to the value passed in.
     * <br>
     * @param waitList - the argument that will be used to set the field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setWaitList(ArrayList<User> waitList) 
	                                              throws NullReferenceException
	{
		if(waitList == null)
			throw new NullReferenceException("Did not set the wait list " +
					                         "because a null reference was " +
					                         "passed in!\n");
		this.waitList = waitList;
	} // end of setWaitList()
	
	
	
	/** 
     * Name: setDropAndWithdrawList <br><br>
     * A mutator to change the dropAndWithdrawList field.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Changes the dropAndWithdrawList to the value passed in.
     * <br>
     * @param dropAndWithdrawList - the argument that will be used to set the
     *                              field
     * @throws NullReferenceException is thrown when a null reference is passed
     *         in.
     */
	public void setDropAndWithdrawList(
			                ArrayList<StringPlusCharacter> dropAndWithdrawList) 
	                                              throws NullReferenceException
	{
		if(dropAndWithdrawList == null)
			throw new NullReferenceException("Did not set the drop and " +
					                         "withdraw list because a null" +
					                         "reference was passed in!\n");
		
		this.dropAndWithdrawList = dropAndWithdrawList;
	} // end of setDropAndWithdrawList()
	
	
	
	/** 
     * Name: compareTo <br><br>
     * Compares two objects and returns a number stating the ordering between
     * two objects.  A positive number states that the calling object would
     * come after the other object.  In contrast a negative number would
     * represent a smaller number.  Zero means that the two object are
     * equivalent.  The objects calling this needs to check for 
     * NullPointerExceptions at runtime, so have this inside a try block.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns a number stating the ordering relationship 
     *                between the calling object and the argument. <br>
     * @param theOtherCourse - the other object will be compared
     * @throws NullPointerException is a unchecked exception that is thrown
     *         when a null argument is passed in
     */
	public int compareTo(Course theOtherCourse)
	{
		if(theOtherCourse == null)
			throw new NullPointerException("Can not compare the object " +
					                       "because a null reference was " +
					                       "passed in!\n");
		
		return courseID.compareTo(theOtherCourse.courseID);
	} // end of compareTo()
	
	public String toString()
	{
		return "Course Name: " + courseName + "\n" +
		       "Section:     " + sectionNumber + "\n" +
		       // DLDLDLDLLDLDLDLDLDLDLDLDLDLDLDLDLLDLDLDLDL
		       "---------------------------------------------\n" +
		       "Capacity:    " + capacity + "\n" +
		       "Current NO.  " + studentList.size() + "\n" +
		       "Student LIST: " + studentList + "\n" +
		       "Current NO. WL: " + waitList.size() + "\n" +
		       "Wait List: " + waitList + "\n" +
		       "---------------------------------------------\n" +
		       // DLDLDLLDLDLDLDDDLDLDLDLLDLDLDLDLDLDLDLDLLD
		       "Semester:    " + semester + "\n" +
		       "Year:        " + year + "\n" +
		       "Course ID:   " + courseID + "\n" +
		       "Instructor:  " + instructorName + "\n\n";
	} // end of toString()
	
	public String showMoreInformation()
	{
		return "Course Name: " + courseName + "\n" +
	           "Section:     " + sectionNumber + "\n" +
	           "Semester:    " + semester + "\n" +
	           "Year:        " + year + "\n" +
	           "Course ID:   " + courseID + "\n" +
	           "Credits:     " + numberOfTotalCredits + "\n" +
	           "Weeks:       " + numberOfWeeks + "\n" +
	           "Start Date:  " + startDate + "\n" +
	           "End Date:    " + endDate + "\n" +
	           "Time:        " + timeHeld.getStartingTime() + " - " +
	                             timeHeld.getEndingTime() + "\n" +
	           "Days:        " + printDaysHeld() + "\n" +
	           "Course Excerpt:" + "\n\n" + courseExcerpt + "\n" +
	           // prerequisites method here
	           "Instructor:  " + instructorName + "\n\n";
	} // end of showMoreInformation()
	
	
	
	/** 
     * Name: printDaysHeld <br><br>
     * Displays the Days the Course is held.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns a String holding the days the Course is held. <br>
     * @param None
     */
	private String printDaysHeld()
	{
		String days = "";
		
		for(String theDays: daysHeld)
		    days += theDays + " ";
		
		return days;
	} // end of printDaysHeld()
	
	
	
	/** 
     * Name: Time <br><br>
     * The constructor that initializes it private data member with the data
     * passed in. <br><br>
     * Precondition: None <br>
     * Postcondition: Creates and initializes the object with the values passed
     *                in. <br>
     * @param startingTime - the starting time for the object
     * @param endingTime - the ending time for the object
     * @throws NotValidArgumentException is thrown if any non valid argument is
     *         passed in, a negative value is passed in the integer parameter
     */
	public String showStudentsInCourse()
	{
		String listOfStudentNames = "";
		
		for(User theStudent: studentList)
		    listOfStudentNames += theStudent.getName() + "\n";
		
		return listOfStudentNames;
	} // end of showStudentsInCourse
	
	
	
	/** 
     * Name: equals <br><br>
     * Compares two objects and determines if they are equal.
     * <br><br>
     * Precondition: None <br>
     * Postcondition: Returns a boolean stating if the object are equal. <br>
     * @param otherTime - the Time that will be compared to the calling object
     */
} // end of Course class